using System;
using System.Xml;

namespace Google.Apps.Provisioning.Actions
{
    /// <summary>
    /// Implements steps specific to a DeleteUser API call.
    /// </summary>
    internal class DeleteUserAction : BaseProvisioningAction
    {
        private string userName;

        public DeleteUserAction( string userName ) : base(
            "Google.Apps.Provisioning.XmlTemplates.DeleteUser.xml",
            "https://www.google.com/a/services/v1.0/Delete/Account" )
        {
            this.userName = userName;
        }

        public override void ProcessRequestXml( XmlDocument doc, XmlNamespaceManager ns )
        {
            doc.SelectSingleNode( "hs:rest/hs:queryData", ns ).InnerText = userName;
        }
    }
}
